<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>


<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>登录</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<style>
	#d{
		border:2px solid grey;
		width:250px;
		padding-left:30px;
		margin:auto;
		margin-top:100px;
		background-color:lightgrey;
	}
	#input1{
		margin-left:9px;
	}
	#input2{
		margin-left:10px;
	}
	#submit{
	    margin-left:40px;
	}
	
	#reset{
	    margin-left:30px;
	}
	</style>
  </head>
  
  <body>
  <div id="d">
  <%
  		Cookie[] cookie=request.getCookies();
  		String name="";
  		String pass="";
  		if(cookie!=null){
  			for(int i=0;i<cookie.length;i++){
  				if(cookie[i].getName().equals("USER_NAME")){
  					 name=cookie[i].getValue();
  				}
  				if(cookie[i].getName().equals("USER_PASS")){
  					 pass=cookie[i].getValue();
  				}
  			}
  		}
   %>
  
  	<%=session.getAttribute("USER") %>
  	<form action="doLogin.jsp" method="post">
  <p>
		<label>登录名</label><input id="input1" type="text" name="name" value="<%=name %>" >  
  </p>
   <p>
		<label>密码</label><input id="input2" type="password" name="pass" value="<%=pass%>">  
  </p>
  <p>
  		<input type="checkbox" name="keep" value="1"/>记住我的登录状态
  </p>
   <p>
		<input id="submit" type="submit" name="submit" value="提交"> 
		<input id="reset" type="reset" name="reset" value="重置">  
  </p>
  </div>
  </form>
  </body>
  
</html>
